<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<script type="text/javascript" charset="utf-8">
	/*
	 *	excel导出
	 */
	function makingReportExportXlsByT() {
		JeecgExcelExport("processReportController.do?exportXlsByT2&type=${type}","makingReport_${type}");
	}
	
</script>

<div class="easyui-layout" fit="true">
  <div region="center" style="padding:1px;">
  <t:datagrid name="makingReport_${type}" title="在制品报表" actionUrl="processReportController.do?making_datagrid"  queryParams="{type:'${type}'}"  idField="id" fit="true" queryMode="group" pagination="true" autoLoadData="true">
   <t:dgCol title="编号"  field="id" hidden="falase" ></t:dgCol>
   <t:dgCol title="当前工序" field="cprocess"  dictionary="ccgx"  query="true" ></t:dgCol>
   <t:dgCol title="本厂批号" field="fbcph" query="true"  autocomplete="true"></t:dgCol>
   <t:dgCol title="物料名称"  field="fwlname" ></t:dgCol>
   <t:dgCol title="投入厚度" field="ftrhd" ></t:dgCol>
   <t:dgCol title="投入宽度" field="ftrkd" ></t:dgCol>
   <t:dgCol title="投入重量" field="ftrzl" ></t:dgCol>
   <t:dgCol title="状态" field="fstate" dictionary="hbstate" style="setColor()" ></t:dgCol>
   <t:dgCol title="投料日期"  field="createDate"    formatter="yyyy-MM-dd hh:mm"  query="true" queryMode="group"></t:dgCol>
   <t:dgToolBar title="查看" icon="icon-search" url="processReportController.do?addorupdate" funname="detail"></t:dgToolBar>
   <t:dgToolBar title="导出Excel" icon="icon-print" onclick="makingReportExportXlsByT()"  operationCode="export"></t:dgToolBar>
  </t:datagrid>
  </div>
</div>
 
 
 <script>
 	function setColor(value,rec,index){
 		
 		if(value==0){
 			return "color:blue;";
 		}
 		if(value==1){
 			return "color:red;";
 		}
 		return "";
 	}
 	
 	
 	function update_check(title,url, id,width,height) {
 	    
 	   
 		var rowsData = $('#'+id).datagrid('getSelections');
		if (!rowsData || rowsData.length==0) {
			tip('请选择编辑项目');
			return;
		}
		if (rowsData.length>1) {
			tip('请选择一条记录再编辑');
			return;
		}
		
		var fstate=rowsData[0].fstate;
		if(fstate!="0" && fstate!="1"){
			tip('该记录已汇报');
			return;
		}
		update(title,url, id,width,height);
	}

   $(document).ready(function(){
		$("input[name='createDate_begin']").attr("class","easyui-datebox");
		$("input[name='createDate_end']").attr("class","easyui-datebox");
	}); 
 </script>